Copyright: Copyright  Sunsoft Systems (NZ) ,  1993


FloatHlp Contents
  Displaying Floating Help Boxes

ShowFloatHelp in FLOATHLP. DLL is a Custom Control  implemented as a function callable from Paradox for Windows, PowerBuilder, Visual Basic, Gupta SQLWINDOWS and others. It displays text in a popup window without requiring user input and stays on top.

Floating Help Box can be used  :

1. As a Data Entry Help Facility where the user gets info on each field as he tabs from field to field.

2. For displaying continuous Progress Messages on a Window without requiring a user input.

 Overview

 Installation

 Using in Paradox for Windows

 PowerBuilder Usage

 SQLWindows Usage

 Visual Basic Usage

Sundar Rajan


FloatHlp Overview
ShowFloatHelp

What is it :

Sometimes, it is necessary to display messages in a status box which stays on top and does not require a user input. Examples are the install programs -   Gupta SQLWINDOWS,  Paradox for Windows and others. These programs display a progress message box in a little window during the installation. Displaying a  Floating Help Box is acheived by using the Windows API Function CreateWindowEx not generally callable from tools such as VB or PDOXWIN.

I wrote ShowFloatHelp to provide users of Paradox for Windows , Visual Basic etc. with a Floating Help Box callable from anywhere in the program.

FLOATHLP can be considered as a Message Box without requiring a user response. It can be positioned on the four corners of the screen , at the center or it can even follow the data entry field!. (not available with PDOXWIN - see Using in PDOXWIN ).

Syntax :

ShowFloatHelp( hWnd, lpString, FloatPosition)

hWnd

Window Handle of the item. This is used in the "Field Follow Mode" (FloatPosition = 5). Otherwise, not used. It can be zero.

lpString

Message Text to be displayed. If left blank, will hide the Floating Help Window.

FloatPosition

Position of Floating Help Box. 0 - Bottom Right, 1 - Bottom Left, 2 - Top Right,

3 - Will display Floating Help on Top Left, 4 - Center of screen , 5  - "Follows Field".

For source code availability , contact the author.


Floathlp Install

FLOATHLP.DLL must reside in the current directory or Windows directory. Just Copy FLOATHLP.DLL to the Windows directory.


PDOXWIN USAGE
Using ShowFloatHelp in Paradox for Windows

In your form uses method, include the following :

Uses floathlp

            ShowFloatHelp(hWnd CWORD, lpString CPTR, FloatPosition CWORD) CWORD

enduses

Here, hWnd is the Window Handle, lpString is a string with the help text or any text to be displayed at the position set by FloatPosition. It can take on four values :

0 - Bottom Right, 1 - Bottom Left, 2 - Top Right, 3 - Will display Floating Help on Top Left,

4-  Center of Screen , 5 - Follows Form Mode

To display help text for a field on the top right corner , as an example , include the following in the setfocus method of the field :

var

    hWnd smallint

endvar

hWnd = WindowHandle()

retval =ShowFloatHelp(hWnd, "HelpText for Data field " + targetname + " Just trying it ..." ,3)

To disable Floating Help, just pass, null or blank lpString parameter to the function.

If you wish to use the field follow mode, where the help box follows the field, set the FloatPosition parameter to 5. Note that this mode does not really work in PDOXWIN since it is not possible to get the Window Handle for a Control Item.


VB USAGE
Using ShowFloatHelp in Visual Basic

ShowFloatHelp is implemented as a function in a DLL and not as a VBX specifically so that it can be used with other tools which do not support the VBX format.

To display floating help in Visual Basic, add the following to the declaration section of your form:

Declare Function ShowFloatHelp Lib "floathlp.dll" (ByVal hWnd As Integer, ByVal lpString As String, ByVal ShowPosn As Integer) As Integer

To test Floating Help using a Push Button named control1 , add the following to the pushbutton  click event :

Dim retval as integer

Dim posn as integer

' display floating help box in the  top right corner

posn = 3

retval  = ShowFloatHelp(control1.hwnd, "VB floathlp message testing  ", posn)


GUPTA USAGE
Gupta SQLWINDOWS USAGE

In the Global Declarations section of the SQL WINDOWS Application, add the following :

Library name: FLOATHLP.DLL

Function: ShowFloatHelp

    Description: Floating Help Box by Sundar Rajan

    Export Ordinal: 3

    Returns

       Boolean: BOOL

Parameters

    Window Handle: HWND

    Receive String: LPSTR

    Number: WORD

To display floating help text , say, On SAM_SetFocus message of a data field, add the following code to the data field's message actions section :

Message Actions

On SAM_SetFocus

      Set bOk =0

      Set lpInfoText = 'Using ShowFloatHelp Example'

      Set bOk = ShowFloatHelp(hWndItem,lpInfoText,5)


PowerBuilder Usage

ShowFloatHelp is implemented as a function in a DLL and not as a VBX specifically so that it can be used with other tools which do not support the VBX format.

To display floating help in PowerBuilder, add the following External Function to a new Window:

 FUNCTION int ShowFloatHelp  (int hWnd, String HelpText, int FloatPosn) LIBRARY "FLOATHLP.DLL"

To test Floating Help using a Push Button named cb_1 ,

add the following to the pushbutton clicked event :

int RetVal

int FloatPosn

// Display floating help box in the  top right corner

FloatPosn = 3

RetVal  = ShowFloatHelp(HANDLE(This), "Floating Help Message Testing using PowerBuilder ", FloatPosn)